package org.example.service;

import lombok.extern.slf4j.Slf4j;
import org.example.entity.Contents;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @Description:
 */

@Service
@Slf4j
public class ContentsService {


    public List<Contents> queryAll() {
        List<Contents> contentsList = new ArrayList<>();

        for (int i = 0; i <= 100; i++) {
            Contents contents = new Contents();
            contents.setId(i);
            contents.setTitle("测试title" + i);
            contents.setIntro("测试intro" + (i % 2));
            contents.setContent("测试content === " + (i % 2));
            contents.setCreateId(i % 2);
            contents.setCreateName(i % 2 == 0 ? "张三" : "李四");
            contents.setCreateTime(new Date());
            contentsList.add(contents);
        }
        return contentsList;
    }
}

